package com.lxw.study.structural.proxy.dynamicproxy.proxyfactory.advice;

import lombok.extern.slf4j.Slf4j;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

@Slf4j
public class MyAroundAdvice implements MethodInterceptor {
    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        String name = invocation.getMethod().getName();
        log.info("方法执行前 :{}", name);
        Object proceed = invocation.proceed();
        log.info("方法执行后 :{}", name);
        return proceed;
    }
}
